<%--
  Created by IntelliJ IDEA.
  User: colt
  Date: 2020/1/2
  Time: 11:35 上午
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <jsp:include page="/layout/_import.jsp"></jsp:include>

    <style>
        .invalid {
            color: red;
        }
    </style>
</head>
<body>
<jsp:include page="/layout/_nav.jsp"></jsp:include>
<div class="container">
    <main role="main" class="pb-3">
        <c:if test="${not empty msg}">
            <div class="alert alert-danger" role="alert">
                    ${msg}
            </div>
        </c:if>
        <form action="/vet" method="post" novalidate="novalidate">
            <input type="hidden" name="m" value="edit">
            <input type="hidden" name="id" value="${vet.id}">

            <div class="form-group row">
                <label class="col-sm-2" for="name">医生姓名</label>
                <div class="col-sm-10">
                    <input value="${vet.name}" class="form-control" type="text" data-val="true" data-val-maxlength="长度不能超过10" data-val-maxlength-max="20" data-val-required="名称是必须的" id="name" maxlength="10" name="name">
                    <span class="invalid field-validation-valid" data-valmsg-for="name" data-valmsg-replace="true"></span>
                </div>
            </div>

            <div class="form-group row">
                <label class="col-sm-2">专业</label>
                <div class="col-sm-10">
                    <c:forEach items="${specs}" var="s">
                        <input type="checkbox" name="specID" value="${s.id}">${s.name}<br>
                    </c:forEach>
                    <span class="invalid field-validation-valid " data-valmsg-for="specs" data-valmsg-replace="true"></span>
                </div>
            </div>
            <input type="submit" class="btn btn-primary" value="保存更改"/>
            <a class="btn btn-secondary" href="/vet">返回列表</a>
    </main>
</div>
<script src="https://cdn.bootcss.com/jquery-validate/1.19.1/jquery.validate.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"></script>
</body>
</html>
